package io.gitee.kotle.android.mvvm.binding

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding

/**
 * 默认通过泛型创建view的逻辑实现类
 */
class MvvmBindingImpl<Binding : ViewBinding> : IMvvmBinding<Binding> {
    private lateinit var binding: Binding

    override val mBinding: Binding
        get() = binding

    override fun onCreateViewBinding(
        self: IMvvmBinding<Binding>,
        inflater: LayoutInflater,
        container: ViewGroup?,
        attach: Boolean
    ): Binding {
        binding = super.onCreateViewBinding(self, inflater, container, attach)
        return binding
    }
}